<template>
  <table-container>
    <lg-table :schema="columns" v-bind="tableProps">
      <template #toolbar-left>代码生成须启动“soar-generator”模块下的“SoarGeneratorApplication”提供服务</template>
      <template #actionbar="{ row }">
        <a @click="genConfigRef.open(row)">生成</a>
      </template>
    </lg-table>
    <gen-config ref="genConfigRef" />
  </table-container>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { LgTable, useTable } from '@/soar';
import { TableContainer } from '@/components';
import { columns } from './config';
import { tableList } from './api';
import GenConfig from './GenConfig.vue';

const genConfigRef = ref();

const { tableProps } = useTable<any>({
  props: {
    rowKey: 'TABLE_NAME',
    alert: false,
    selection: false,
    paramsHandle(_: any, raw: any) {
      return { ...raw.params, ...raw.page };
    },
    data: tableList,
  },
});
</script>
